import 'package:base_flutter/base_flutter.dart';
import 'package:fan_da_app/model/shop_car_model.dart';

class FoodListViewModel extends BaseListViewModel<String>{
  dynamic type;
  FoodListViewModel(super.context,{this.type});

  @override
  Future<List<String>> requestListData() {
    return Future(() => ["${type}1","${type}2","${type}3","${type}4","${type}5"]);
  }

  @override
  void onCreated() {
    super.onCreated();
    requestRefresh();
  }

  void onItemClick(String item){
    if(item.contain){
      ShopCarModel.instance.removeItem(item);
    }else{
      ShopCarModel.instance.addItem(item);
    }
    notifyListeners();
  }

}